﻿<!DOCTYPE html>
<html>

<head>
	<title>DTU管理平台</title>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<title></title>
	<link rel="stylesheet" href="css/reset.css" />
	<link rel="stylesheet" href="css/login.css" />
	<script type="text/javascript" src="js/jquery.min.js"></script>
	<script type="text/javascript" src="js/login.js"></script>
</head>

<body>
	<div class="page">
		<div class="loginwarrp">
			<div class="logo">管理员登陆</div>
			<div class="login_form">
				<form id="Login" name="Login" method="post" onsubmit="" action="">
					<li class="login-item">
						<span>用户名：</span>
						<input type="text" id="username" name="user" class="login_input">
						<span id="count-msg" class="error"></span>
					</li>
					<li class="login-item">
						<span>密　码：</span>
						<input type="password" id="password" name="password" class="login_input">
						<span id="password-msg" class="error"></span>
					</li>
					<!-- <li class="login-item verify">
					<span>验证码：</span>
					<input type="text" name="CheckCode" class="login_input verify_input">
				</li> 
				<img src="images/verify.png" border="0" class="verifyimg" />-->
					<div class="clearfix"></div>
					<li class="login-sub">
						<input type="button" name="Submit" value="登录" onclick="login()" />
						<input type="reset" name="Reset" value="重置" />
					</li>
				</form>
			</div>
		</div>
	</div>
	<script type="text/javascript">
		function getFormJson(frm) { //frm：form表单的id
			var o = {};
			var a = $("#" + frm).serializeArray();
			$.each(a, function () {
				if (o[this.name] !== undefined) {
					if (!o[this.name].push) {
						o[this.name] = [o[this.name]];
					}
					o[this.name].push(this.value || '');
				} else {
					o[this.name] = this.value || '';
				}
			});
			return o;
		}
		function login() {
			$.post("/api/login", JSON.stringify(getFormJson("Login")), function (data) {
				if (data['status']==0) {
					window.location.href='home.html';
				}else{
					alert(data['msg']);
				}
			})
		}
		window.onload = function () {
			var config = {
				vx: 4,
				vy: 4,
				height: 2,
				width: 2,
				count: 100,
				color: "121, 162, 185",
				stroke: "100, 200, 180",
				dist: 6000,
				e_dist: 20000,
				max_conn: 10
			}
			CanvasParticle(config);
		}
	</script>
	<script type="text/javascript" src="js/canvas-particle.js"></script>
</body>

</html>